import Vue from 'vue'
import Router from 'vue-router'
import Nav from '../pages/Nav'
import BaseInfo from '../pages/BaseInfo'
import PackageList from '../pages/PackageList'
import PackageLogs from '../pages/PackageLogs'
import ListItem from '../components/ListItem'
import InstallOrUpgradePage from '../pages/InstallOrUpgradePage'
import PreviewPage from '../pages/PreviewPage'
import Protect from '../pages/Protect.vue'

Vue.use(Router)

export default new Router({
  mode: 'hash',
  routes: [
    /*{
      path: '/baseInfo',
      name: 'baseInfo',
      component: BaseInfo
    },
    {
      path: '/installPage',
      name: 'installPage',
      component: InstallOrUpgradePage
    },
    {
      path: '/upgradePage',
      name: 'upgradePage',
      component: InstallOrUpgradePage
    },
    {
      path: '/packageManagement',
      name: 'packageManagement',
      component: packageList
    },
    {
      path: '/packageLogs',
      name: 'packageLogs',
      component: packageList
    },
    {
      path: '*',
      redirect: '/baseInfo'
    }*/

    {
      path: '/nav',
      name: 'nav',
      component: Nav,
      children: [
        {
          path: '', // 空路由（默认）
          redirect: '/nav/baseInfo',
        },
        {
          path: 'protect',
          name: 'protect',
          component: Protect
        },
        {
          path: 'baseInfo',
          name: 'baseInfo',
          component: BaseInfo
        },
        {
          path: 'installPage',
          name: 'installPage',
          component: InstallOrUpgradePage
        },
        {
          path: 'upgradePage',
          name: 'upgradePage',
          component: InstallOrUpgradePage
        },
        {
          path: 'packageManagement',
          name: 'packageManagement',
          component: PackageList
        },
        {
          path: 'packageLogs',
          name: 'packageLogs',
          component: PackageLogs
        },
        {
          path: '',
          component: BaseInfo
        }
      ]
    },
    {
      path: '/',
      redirect: '/nav',
    },
    {
      path: '/preview',
      name: 'preview',
      component: PreviewPage
    }




  ]
})
